from common.setting import ensure_path_sep
from utils.mysqlUtils.db_pool import Database

product_db = Database(ensure_path_sep("\\config\\shopeev2_config.yaml.bak"), "HWY-ZH-GZ-RDS-Product")



class Tproduct_image_audit:



    @staticmethod
    def get_review_status_by_sku(sku_list):
        review_pass_sku_list = []
        get_data = f"""
        select sku
        from `zhcxkj-center-product`.t_product_image_audit
        where sku in %s
        and review_status in (1,2)
        and is_deleted=0
        group by sku
        """
        res = product_db.fetch_all_tuple(get_data,(set(sku_list),))
        if len(res):
            review_pass_sku_list = list(map(lambda x:x[0],res))
        return review_pass_sku_list